import http from '@/utils/http.js';
const tranvip = {
	/*
	 * 方法说明: 示例请求方法
	 * author: gaomingzhe
	 * description: 
	 * @param {}   
	 * @return 
	 * @createTime: 2021-12-5 2:52:38 ?F10: PM?
	 */
	//高铁贵宾厅 - 列表
	async getTrainRoomList({commit}, data) {
		let city_id = uni.getStorageSync('city_id')
		let params
		if (city_id) {
			params = {
				...data,
				city_id
			}
		} else {
			params = data
			params.city_id = 1
		}
		const res = await uni.$request('/api/viplounge/get_list', params)
		if (res.errno != 0) uni.$toast('请求失败！')
		return res.data
	},
	//高铁贵宾厅 - 详情
	async getTrainRoomDetail({commit}, data) {
		let params = data
		const res = await uni.$request('/api/viplounge/get_detail', params)
		if (res.errno != 0) uni.$toast('请求失败！')
		return res.data
	},
	//高铁贵宾厅 - 简易数据
	// "data": {
	//         "tag": [{
	//             "title": "航班查询"
	//         }, {
	//             "title": "WiFi"
	//         }, {
	//             "title": "小食"
	//         }],
	//         "title": "易登机接待中心(T3国内)",
	//         "remind": "请提前四个小时预约!!!",
	//         "price": "998.00",
	//         "integral": 0,
	//         "vip": 0,
	//         "delay_hours": "5"
	//     }
	async getTrainRoomDetailSome({commit}, data) {
		let params = data
		const res = await uni.$request('/api/viplounge/get_detail_some', params)
		if (res.errno != 0) uni.$toast('请求失败！')
		return res.data
	},
	//高铁贵宾厅 - 下单
	async getTrainApplyOrder({
		commit
	}, data) {
		let params = data
		const res = await uni.$postRequest('/api/apply_order/buildorder', params)
		console.log(res)
		if (res.errno != 0) uni.$toast('请求失败！')
		return res.data
	},
	//机场贵宾厅 - 预约订单 - 订单详情
	async airVipOrderDetail({
		commit
	}, data) {
		let params = data
		const res = await uni.$postRequest('/api/apply_order/get_detail', params)
		console.log(res)
		if (res.errno != 0) uni.$toast('请求失败！')
		return res.data
	},
	
};

export default tranvip;